{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    {include file="form" /}
    <div class="cl pd-5 bg-1 bk-gray">
        <span class="l">
            {tp:menu menu="add,forbid,resume,delete,recyclebin" /}
        </span>
        <span class="r pt-5 pr-5">
            共有数据 ：<strong>{$count ?? '0'}</strong> 条
        </span>
    </div>
    <table class="table table-border table-bordered table-hover table-bg mt-20">
        <thead>
        <tr class="text-c">
            {include file="th" /}
            <th width="70">操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
        <tr class="text-c">
            {include file="td" /}
            <td class="f-14">
                {if condition="$vo['check']!=1"}
                    <a href="javascript:;"  onclick="agree('/admin/driver_rank_apply/agree/id/{$vo.id}')" class="label label-warning radius" title="通过并升级">通过并升级</a>
                    <a href="javascript:;"   onclick="reject('/admin/driver_rank_apply/reject/id/{$vo.id}')" class="label label-warning radius" title="不通过">不通过</a>
                    {$vo.status|show_status=$vo.id}
                    {tp:menu menu='sedit' /}
                {/if}
                {tp:menu menu='sdelete' /}
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="page-bootstrap">{$page ?? ''}</div>
</div>
<script type="text/javascript">
    function agree(url) {
        $.ajax({
            type: 'POST',
            url: url,
            data: null,
            success: function (re){
                if(re.msg) {
                    layer.msg(re.msg, {
                        time: 20000, //20s后自动关闭
                        btn: ['知道了']
                    }, function () {
                        location.reload()
                    });
                }else{
                    layer_open('通过并升级','/admin/pub/role/id/1')
                }
            },
        });
    }
    function reject(url) {
        $.ajax({
            type: 'POST',
            url: url,
            data: null,
            success: function (re){
                if(re.msg) {
                    layer.msg(re.msg, {
                        time: 20000, //20s后自动关闭
                        btn: ['知道了']
                    }, function () {
                        location.reload()
                    });
                }else{
                    layer_open('不通过','/admin/pub/role/id/1')
                }
            },
        });
    }
</script>
{/block}

